import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/pro-list/:categoryId',
    name: 'pro-list',
    component: () => import('@/views/product/pro-list')
  },
  {
    path: '/unlist/:categoryId/:timeId',
    name: 'unlist',
    component: () => import('@/views/unusual/un-list')
  },
  {
    path: '/unInfolist',
    name: 'unInfolist',
    component: () => import('@/views/unusual/unInfoList')
  },
  {
    path: '/un-detail',
    name: 'un-detail',
    component: () => import('@/views/unusual/un-detail')
  },
  {
    path: '/perform/applyTime',
    name: 'applyTime',
    component: () => import('@/views/perform/apply-time')
  },
  {
    path: '/perform/applyList',
    name: 'applyList',
    component: () => import('@/views/perform/applyTimeList')
  },
  {
    path: '/perform/applyDoneList',
    name: 'applydonelist',
    component: () => import('@/views/perform/applyDoneList')
  },
  {
    path: '/perform/applyCheckList',
    name: 'applyCheckList',
    component: () => import('@/views/perform/applyCheckList')
  },
  {
    path: '/perform/applyCheckDoneList',
    name: 'applyCheckDoneList',
    component: () => import('@/views/perform/applyCheckDoneList')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/login'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/login/register'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/farm',
    name: 'farm',
    component: () => import('@/views/device/device-check/equip-qr'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/list',
    name: 'selectCheckList',
    component: () => import('@/views/device/device-check/list'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/manage',
    name: 'checkManage',
    component: () => import('@/views/device/manage/checkManage'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/manage/awaitAppoint',
    name: 'awaitAppoint',
    component: () => import('@/views/device/manage/awaitAppoint.vue'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/manage/overdone',
    name: 'overdone',
    component: () => import('@/views/device/manage/over-done'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/manage/awaitDone',
    name: 'awaitDone',
    component: () => import('@/views/device/manage/awaitDone'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/manage/DoneList',
    name: 'DoneList',
    component: () => import('@/views/device/manage/DoneList'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/task/MyTask',
    name: 'MyTask',
    component: () => import('@/views/device/my-task/my-task'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/task/taskDetail',
    name: 'taskDetail',
    component: () => import('@/views/device/my-task/task-detail'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/perform/index',
    name: 'performIndex',
    component: () => import('@/views/device/perform-pingj/index'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check/perform/list',
    name: 'performList',
    component: () => import('@/views/device/perform-pingj/perform-list'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/device/device-qr',
    name: 'deviceQR',
    component: () => import('@/views/device/device-check/device-qr'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/application/check-list',
    name: 'checkList',
    component: () => import('@/views/device/device-check/check-list.vue'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/check-area',
    name: 'checkArea',
    component: () => import('@/views/device/device-check/check-area.vue'),
    meta: {
      keepAlive: true
    }
  },
  {
    path: '/',
    name: 'main',
    component: () => import('@/views/main'),
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/index',
    component: () => import('@/views/layout/index'),
    children: [
      {
        path: '/product',
        component: () => import('@/views/product/product'),
        meta: {
          keepAlive: true // 需要被缓存
        }
      },
      {
        path: '/staff',
        component: () => import('@/views/staff/staff'),
        meta: {
          keepAlive: true // 需要被缓存
        }
      },
      {
        path: '/unusual',
        component: () => import('@/views/unusual/unusual'),
        meta: {
          keepAlive: true // 需要被缓存
        }
      },
      {
        path: '/target',
        component: () => import('@/views/target/target'),
        meta: {
          keepAlive: true // 需要被缓存
        }
      },
      {
        path: '/perform',
        name: 'perform',
        component: () => import('@/views/perform/perform'),
        meta: {
          keepAlive: true // 需要被缓存
        }
      },


    ]
  }
]

const router = new VueRouter({
  mode: "hash",
  routes
})

export default router
